﻿<%@ Page CodeFileBaseClass="AliCMS.Lib.SystemPageBase" %>
<%@ Register TagPrefix="alicmsUC" TagName="Ime" Src="../../ime.dwt.ascx"%>
<%@ Register TagPrefix="alicmsUC" TagName="LanguageMenu" Src="../../language_menu.dwt.ascx"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- TemplateInfo codeOutsideHTMLIsLocked="true" -->
<ali:Get ID="Vote" Object="Vote" InnerID="Request.QueryString['ID']" Validate="True" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>编辑投票</title>
<link rel="stylesheet" type="text/css" href="<%=CommonPath%>jquery/themes/lightness/all.css" />
<ali:Comment><link rel="stylesheet" type="text/css" href="../../S01/CHS/css/common.css" /></ali:Comment>
<link rel="stylesheet" href="<%=CssPath%>common.css" />
<alicmsUC:Ime Ime="true" Eot="true" runat="server" />
<style type="text/css">
form .SubTable{width:700px;background:#FFF}
form .SubTable THEAD TH,form .SubTable TD{text-align:center}
</style>
<script>
var _page = 'vote_edit',
	_lang = '<%=ContentLang%>',
	_webPath = '<%=WebPath%>',
	_imagePath = '<%=ImagePath%>',
	_id = <%=Vote[InnerID]%>,
	_guid = '<%=Vote[ID]%>',
	_lang_working = '正在操作...',
	_lang_operation_fail = '操作失败！',
	_lang_operation_success = '操作成功！',
	_lang_name_empty = '名称不能空！',
	_lang_time_limit_for_same_user_incorrect = '时限不正确！',
	_lang_select_option = '请添加选项！',
	_lang_start_upload = '开始上传...',
	_lang_uploading = '正在上传图片...',
	_lang_browse = '浏览...',
	_lang_move_up = '上移',
	_lang_move_down = '下移',
	_lang_delete = '删除';
</script>
</head>
<body>
<div class="WhiteHeader">
	<div class="Left"><img src="<%=ImagePath%>close_frame.gif" /></div>
	<div class="Title"><a href="../vote/list.aspx?Lang=<%=ContentLang%>">投票列表</a> → <span class="<%=ContentLang%>Font"><%=Vote[Name]%></span></div>
	<div class="Right">
		<alicmsUC:LanguageMenu runat="server" />
		<img height="15" src="<%=ImagePath%>dropdown.gif" /> 语言：<%=CurrentLanguage%>
	</div>
</div>
<div class="Block">
	<ul class="TabMenu">
		<li class="Left Selected"></li>
		<li class="Middle Selected">编辑</li>
		<li class="Right Selected"></li>
		<li class="Left"></li>
		<li class="Middle"><a href="../vote/result/list.aspx?Lang=<%=ContentLang%>&amp;VoteID=<%=Request.QueryString["ID"]%>">结果清单</a></li>
		<li class="Right"></li>
		<li class="Left"></li>
		<li class="Middle"><a href="../vote/stat.aspx?Lang=<%=ContentLang%>&amp;ID=<%=Request.QueryString["VoteID"]%>">结果统计</a></li>
		<li class="Right"></li>
	</ul>
	<ul class="Title">
		<li class="Left"></li>
		<li class="Middle"></li>
		<li class="Right"></li>
	</ul>
	<form>
		<table border="0" cellpadding="4" cellspacing="1">
			<tfoot>
				<tr><td colspan="2"><input type="submit" value="保 存" /></td></tr>
			</tfoot>
			<tbody>
				<tr>
					<th>名称：</th>
					<td><input type="text" name="Name" value="<%=Vote[Name]%>" size="50" maxlength="255" class="Text <%=ContentLang%>Font" /></td>
				</tr>
				<tr>
					<th>是否单选：</th>
					<td>
						<%If Convert.ToBoolean(Vote[IsSingle])%>
							<input type="radio" name="IsSingle" id="IsSingleYes" checked="checked" /><label for="IsSingleYes">是</label>
							<input type="radio" name="IsSingle" id="IsSingleNo" /><label for="IsSingleNo">否</label>
						<%Else%>
							<input type="radio" name="IsSingle" id="IsSingleYes" /><label for="IsSingleYes">是</label>
							<input type="radio" name="IsSingle" id="IsSingleNo" checked="checked" /><label for="IsSingleNo">否</label>
						<%EndIf%>
					</td>
				</tr>
				<tr>
					<th>时限：</th>
					<td>
						<input type="text" name="TimeLimitForSameUser" value="<%=Vote[TimeLimitForSameUser]%>" size="10" maxlength="10" class="Text" />
						<select name="Unit">
							<option value="Minute">分钟</option>
							<option value="Hour">小时</option>
							<option value="Day" selected="selected">天</option>
						</select>
						同一用户在指定时间段内只能投一次票。单位为分钟。留空，表示不限制。
					</td>
				</tr>
				<tr>
					<th>选项：</th>
					<td>
						<button type="button" id="option-add">增加选项</button>
						<table id="options-table" border="0" cellpadding="4" cellspacing="1" class="SubTable">
							<thead>
								<tr>
									<th>名称</th>
									<th width="200">图片</th>
									<th width="100">移动</th>
									<th width="60">删除</th>
								</tr>
							</thead>
							<tbody>
								<ali:List Object="Vote.Option" Condition="VoteID=Vote[ID]">
									<ali:Record>
										<tr data-id="<%=InnerID%>" data-sort="<%=Sort%>" data-content="<%=HttpUtility.HtmlEncode(Convert.ToString(Content))%>">
											<td><input type="text" value="<%=Name%>" size="40" class="Text <%=ContentLang%>Font"><button type="button">...</button></td>
											<td><input id="picture<%=Index%>-textbox" type="text" value="<%=Picture%>" class="Text"><input id="picture<%=Index%>-browse" type="button" value="浏览..."></td>
											<td><button type="button" data-action="MoveUp">上移</button><button type="button" data-action="MoveDown">下移</button></td>
											<td><button type="button" data-action="Delete">删除</button></td>
										</tr>
									</ali:Record>
								</ali:List>
								<tr id="option-edit" style="display:none"><td colspan="4"><textarea rows="5" style="width:90%" class="Text <%=ContentLang%>Font"></textarea></td></tr>
							</tbody>
						</table>
					</td>
				</tr>
				<tr>
					<th>描述：</th>
					<td>
						<textarea name="Description" data-lang="<%=PageLang%>" data-content-lang="<%=ContentLang%>" data-browse-url="<%=AdminBrowserURL%>?Root=<%=InstanceID%>" class="editor"><%=HttpUtility.HtmlEncode(Vote[Description].ToString())%></textarea>
					</td>
				</tr>
			</tbody>
		</table>
	</form>
	<div class="Footer"></div>
</div>
<script type="text/javascript" src="<%=CommonPath%>jquery/core.js"></script>
<script type="text/javascript" src="<%=CommonPath%>jquery/ui.js"></script>
<script type="text/javascript" src="<%=CommonPath%>uploader.js"></script>
<script type="text/javascript" src="<%=CommonPath%>utility.js"></script>
<script type="text/javascript" src="<%=JsPath%>global.js"></script>
<script type="text/javascript" src="<%=ModuleJsPath%>module.js"></script>
</body>
</html>